package com.lancoo.taskerdemo.network;

import rx.functions.Func1;

/**
 * Created by gongwq on 2017/6/20 0020.
 */


public class ApiFunc2<T> implements Func1<ApiResponse<T>, T> {

    @Override
    public T call(ApiResponse<T> response) {
        int error_code = response.error_code;
        if (error_code != 0) {
            throw new ApiException(response.message);
        }
//        if (!errorCode.endsWith("00")) {
//            throw new ApiException(errorCode, response.reason, response.message);
//        }
        return response.result;
    }
}

